package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_交易申请合同表 实体类。
 *
 * @author 11987
 * @since 2025-06-03
 */
@Table(value = "LINDI_TRADE_APPLICATION_CONTRACT", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplicationContract extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 指标交易申请合同ID
     */
    private Long tradeApplicationContractId;

    /**
     * 交易申请ID
     */
    private Long tradeApplicationId;

    /**
     * 合同文件ID
     */
    private Long contractFileId;

    /**
     * 合同编号
     */
    private String contractNumber;

    /**
     * 合同名称
     */
    private String contractName;

    /**
     * 合同金额(万元)
     */
    private String contractAmount;

    /**
     * 签订日期
     */
    private LocalDateTime effectiveDate;

    /**
     * 合同类型
     */
    private String contractType;

    // 无参构造函数
    public LindiTradeApplicationContract() {
        super();
    }

    // 全参构造函数
    public LindiTradeApplicationContract(Long tradeApplicationContractId, Long tradeApplicationId, Long contractFileId, 
                                       String contractNumber, String contractName, String contractAmount, 
                                       LocalDateTime effectiveDate, String contractType) {
        super();
        this.tradeApplicationContractId = tradeApplicationContractId;
        this.tradeApplicationId = tradeApplicationId;
        this.contractFileId = contractFileId;
        this.contractNumber = contractNumber;
        this.contractName = contractName;
        this.contractAmount = contractAmount;
        this.effectiveDate = effectiveDate;
        this.contractType = contractType;
    }

    // Getter和Setter方法
    public Long getTradeApplicationContractId() {
        return tradeApplicationContractId;
    }

    public void setTradeApplicationContractId(Long tradeApplicationContractId) {
        this.tradeApplicationContractId = tradeApplicationContractId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getContractFileId() {
        return contractFileId;
    }

    public void setContractFileId(Long contractFileId) {
        this.contractFileId = contractFileId;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public String getContractName() {
        return contractName;
    }

    public void setContractName(String contractName) {
        this.contractName = contractName;
    }

    public String getContractAmount() {
        return contractAmount;
    }

    public void setContractAmount(String contractAmount) {
        this.contractAmount = contractAmount;
    }

    public LocalDateTime getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(LocalDateTime effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public String getContractType() {
        return contractType;
    }

    public void setContractType(String contractType) {
        this.contractType = contractType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplicationContract that = (LindiTradeApplicationContract) o;
        return Objects.equals(tradeApplicationContractId, that.tradeApplicationContractId) &&
               Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
               Objects.equals(contractFileId, that.contractFileId) &&
               Objects.equals(contractNumber, that.contractNumber) &&
               Objects.equals(contractName, that.contractName) &&
               Objects.equals(contractAmount, that.contractAmount) &&
               Objects.equals(effectiveDate, that.effectiveDate) &&
               Objects.equals(contractType, that.contractType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), tradeApplicationContractId, tradeApplicationId, contractFileId, 
                           contractNumber, contractName, contractAmount, effectiveDate, contractType);
    }

    @Override
    public String toString() {
        return "LindiTradeApplicationContract{" +
                "tradeApplicationContractId=" + tradeApplicationContractId +
                ", tradeApplicationId=" + tradeApplicationId +
                ", contractFileId=" + contractFileId +
                ", contractNumber='" + contractNumber + '\'' +
                ", contractName='" + contractName + '\'' +
                ", contractAmount='" + contractAmount + '\'' +
                ", effectiveDate=" + effectiveDate +
                ", contractType='" + contractType + '\'' +
                "} " + super.toString();
    }

    // Builder类
    public static class Builder {
        private Long tradeApplicationContractId;
        private Long tradeApplicationId;
        private Long contractFileId;
        private String contractNumber;
        private String contractName;
        private String contractAmount;
        private LocalDateTime effectiveDate;
        private String contractType;

        public Builder tradeApplicationContractId(Long tradeApplicationContractId) {
            this.tradeApplicationContractId = tradeApplicationContractId;
            return this;
        }

        public Builder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder contractFileId(Long contractFileId) {
            this.contractFileId = contractFileId;
            return this;
        }

        public Builder contractNumber(String contractNumber) {
            this.contractNumber = contractNumber;
            return this;
        }

        public Builder contractName(String contractName) {
            this.contractName = contractName;
            return this;
        }

        public Builder contractAmount(String contractAmount) {
            this.contractAmount = contractAmount;
            return this;
        }

        public Builder effectiveDate(LocalDateTime effectiveDate) {
            this.effectiveDate = effectiveDate;
            return this;
        }

        public Builder contractType(String contractType) {
            this.contractType = contractType;
            return this;
        }

        public LindiTradeApplicationContract build() {
            return new LindiTradeApplicationContract(tradeApplicationContractId, tradeApplicationId, contractFileId,
                                                   contractNumber, contractName, contractAmount, effectiveDate, contractType);
        }
    }

    public static Builder builder() {
        return new Builder();
    }

}
